package com.wecode.core.utils;

import java.util.Collection;

/**
 * Created by youngwa on 2018/12/12. 22:58
 */
public class CollectionUtils {

  public static <T extends Number> double sum(Collection<T> collection) {
    double result = 0;
    for (T t : collection) {
      result += t.doubleValue();
    }
    return result;
  }
}
